﻿using Pay.DTO;
using Pay.TO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.IService
{
    public interface IProductActivityService {

        #region 公共方法
        /// <summary>
        /// 获得活动产品分页列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        PagedResult<product_dto> Gets(ProductActivityQuery query);
        /// <summary>
        /// 根据产品Id 获取当前是否参与活动
        /// </summary>
        /// <param name="product_id"></param>
        /// <returns></returns>
        product_activity_dto GetAvailable(long product_id, long sku_id = 0);
        /// <summary>
        /// 根据产品Id 获得正在进行中或者预热中的活动
        /// </summary>
        /// <param name="product_id"></param>
        /// <returns></returns>
        product_activity_dto GetAvailableOrPreheat(long product_id, long sku_id = 0);
        /// <summary>
        /// 产品活动处理
        /// </summary>
        /// <param name="dto"></param>
        /// <param name="isIncludePreHeat">是否包含预热</param>
        /// <param name="isOnlyCashPay">仅使用现金支付</param>
        /// <returns></returns>
        product_dto ProductActivityHandle(product_dto dto, bool isIncludePreHeat = false, bool isOnlyCashPay = false);
        /// <summary>
        /// 产品规格活动处理
        /// </summary>
        /// <param name="dto"></param>
        /// <param name="isIncludePreHeat"></param>
        /// <param name="isOnlyCashPay">仅使用现金支付</param>
        /// <returns></returns>
        product_sku_dto SkuActivityHandle(product_sku_dto dto, bool isIncludePreHeat = false, bool isOnlyCashPay = false);
        #endregion

        #region 限时购
        /// <summary>
        /// 获得活动对应的限时购数据（用于编辑）
        /// </summary>
        /// <param name="activityId"></param>
        /// <returns></returns>
        List<product_activity_time_buy_edit_model> GetProductTimeBuyEdit(long activityId);
        /// <summary>
        /// 新增或修改限时购
        /// </summary>
        /// <param name="editModel"></param>
        /// <returns></returns>
        bool AddOrUpdateProductTimeBuy(product_activity_time_buy_edit editModel);
        #endregion
    }
}
